﻿<Window
	x:Class="WpfCmd.MainWindow"
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    Title="DOS Command" Height="641" Width="640" 
    MouseWheel="Window_MouseWheel" 
    KeyUp="Window_KeyUp"
    KeyDown="Window_KeyDown"  
    WindowStyle="None" mc:Ignorable="d" AllowsTransparency="True" 
    Icon="/WpfCmd;component/Box_Green.ico">

	<Window.Resources>
		<LinearGradientBrush x:Key="TextBoxBorder" EndPoint="0,20" StartPoint="0,0" MappingMode="Absolute">
			<GradientStop Color="#ABADB3" Offset="0.05"/>
			<GradientStop Color="#E2E3EA" Offset="0.07"/>
			<GradientStop Color="#E3E9EF" Offset="1"/>
		</LinearGradientBrush>
		<Style x:Key="{x:Type TextBoxBase}" BasedOn="{x:Null}" TargetType="{x:Type TextBoxBase}">
			<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
			<Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.WindowBrushKey}}"/>
			<Setter Property="BorderBrush" Value="{StaticResource TextBoxBorder}"/>
			<Setter Property="BorderThickness" Value="1"/>
			<Setter Property="Padding" Value="1"/>
			<Setter Property="AllowDrop" Value="true"/>
			<Setter Property="FocusVisualStyle" Value="{x:Null}"/>
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="{x:Type TextBoxBase}">
						<Grid>
							<Rectangle Fill="{TemplateBinding Background}" Stroke="{TemplateBinding BorderBrush}" RadiusX="20.5" RadiusY="20.5" HorizontalAlignment="Stretch" Margin="0,0,2,8" VerticalAlignment="Stretch" Width="Auto" Height="Auto"/>
							<ScrollViewer x:Name="PART_ContentHost" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" Margin="2" Opacity="{TemplateBinding Opacity}" Foreground="{TemplateBinding Foreground}" OpacityMask="{TemplateBinding OpacityMask}"/>
						</Grid>
						<ControlTemplate.Triggers>
							<Trigger Property="IsEnabled" Value="false">
								<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
							</Trigger>
						</ControlTemplate.Triggers>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
		<Style x:Key="{x:Type Hyperlink}" TargetType="{x:Type Hyperlink}">
			<Setter Property="Foreground" Value="Blue"/>
			<Setter Property="TextDecorations" Value="Underline"/>
			<Style.Triggers>
				<Trigger Property="IsMouseOver" Value="true">
					<Setter Property="Foreground" Value="Red"/>
				</Trigger>
				<Trigger Property="IsEnabled" Value="false">
					<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
				</Trigger>
				<Trigger Property="IsEnabled" Value="true">
					<Setter Property="Cursor" Value="Hand"/>
				</Trigger>
			</Style.Triggers>
		</Style>
		<Style x:Key="RichTextBoxStyle1" TargetType="{x:Type RichTextBox}">
			<Style.Resources>
				<Style x:Key="{x:Type FlowDocument}" TargetType="{x:Type FlowDocument}">
					<Setter Property="OverridesDefaultStyle" Value="true"/>
				</Style>
				<Style x:Key="{x:Type Hyperlink}" BasedOn="{StaticResource {x:Type Hyperlink}}" TargetType="{x:Type Hyperlink}">
					<Style.Triggers>
						<Trigger Property="IsMouseOver" Value="true">
							<Setter Property="Foreground" Value="Blue"/>
						</Trigger>
						<Trigger Property="IsEnabled" Value="false">
							<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
						</Trigger>
					</Style.Triggers>
				</Style>
			</Style.Resources>
			<Setter Property="MinWidth" Value="10"/>
			<Style.BasedOn>
				<StaticResource ResourceKey="{x:Type TextBoxBase}"/>
			</Style.BasedOn>
		</Style>
		<Style x:Key="TextBoxStyle1" BasedOn="{x:Null}" TargetType="{x:Type TextBox}">
			<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
			<Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.WindowBrushKey}}"/>
			<Setter Property="BorderBrush" Value="{StaticResource TextBoxBorder}"/>
			<Setter Property="BorderThickness" Value="1"/>
			<Setter Property="Padding" Value="1"/>
			<Setter Property="AllowDrop" Value="true"/>
			<Setter Property="FocusVisualStyle" Value="{x:Null}"/>
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="{x:Type TextBox}">
						<Grid>
							<Rectangle Fill="{TemplateBinding Background}" Stroke="{TemplateBinding BorderBrush}" HorizontalAlignment="Stretch" Width="Auto" RadiusX="7.5" RadiusY="7.5"/>
							<ScrollViewer x:Name="PART_ContentHost" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" Margin="2"/>
						</Grid>
						<ControlTemplate.Triggers>
							<Trigger Property="IsEnabled" Value="false">
								<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
							</Trigger>
						</ControlTemplate.Triggers>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
	</Window.Resources>
    <Window.Background>
        <SolidColorBrush />
    </Window.Background>
    <Grid x:Name="grdWindow">
        <Grid.RowDefinitions>
            <RowDefinition Height="*" />
            <RowDefinition Height="25" />
        </Grid.RowDefinitions>

        <RichTextBox x:Name="txtResult" Foreground="#FFFEF3AA" 
                     IsReadOnly="True" Opacity="0.869" OpacityMask="Black" Style="{DynamicResource RichTextBoxStyle1}" Background="#FF200101">
        	<RichTextBox.BorderBrush>
        		<RadialGradientBrush>
        			<GradientStop Color="#FFABADB3" Offset="0.05"/>
        			<GradientStop Color="#FFE2E3EA" Offset="0.07"/>
        			<GradientStop Color="#FF8DC6FF" Offset="1"/>
        		</RadialGradientBrush>
        	</RichTextBox.BorderBrush>
            <RichTextBox.LayoutTransform>
                <ScaleTransform x:Name="scaler" CenterX="0"  CenterY="0" />
            </RichTextBox.LayoutTransform>
        </RichTextBox>
        <TextBox x:Name="txtCommand" 
                 KeyDown="OnCommandKeyDown" 
                 PreviewKeyDown="txtCommand_PreviewKeyDown"
                 FontSize="14" FontFamily="Consolas" 
				 Text="ping www.google.com" 
				 VerticalContentAlignment="Center" Grid.Row="1" TabIndex="0" Style="{DynamicResource TextBoxStyle1}" Opacity="0.7" Background="#FF110728" Foreground="White" OpacityMask="White" />
        
    </Grid>
</Window>

